<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<?php        
	$title = "Exemplo de MD5";
	
	$strText = isset($_POST["txtTexto"])  ? $_POST["txtTexto"] : "";
	if ($strText != "")
		$cripto = md5($strText);
	else 
		$cripto = "";
		
?>

<html>
    <head>
        <meta http-equiv="pragma" content="nocache">
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <script language="javascript" type="text/javascript">
            function setaFoco(){
                window.document.getElementById("txtTexto").focus();
            }
            function validaPagina(){
                var objNome = document.getElementById("txtTexto");
                if (objNome.value == ""){
                    alert("Informe o Nome");
                    objNome.focus();
                    return false;
                }
                return true;
            }
        </script>
        <title><?php echo $title?></title>
    </head>
    <?php include 'menu.php'; ?>
    <body onload="setaFoco();">
        <h1><?php echo $title?></h1>
        <form method="post" action=""><br><br>
            <b>Texto:</b>&nbsp;&nbsp;
            <input type="text" name="txtTexto" id="txtTexto" value="<?php echo $strText?>">
            &nbsp;&nbsp;
            <input type="submit" name="btnSubmit" id="btnSubmit" value="Enviar"
                   onclick="return validaPagina();">
            <br><br>
        </form>
        <?php echo $cripto; ?>
    </body>
</html>